import { create } from "zustand";
import { createJSONStorage, persist } from "zustand/middleware";

export const useUserInfoStore = create()(
  persist(
    (set) => ({
      name: "",
      idCard: "",
      phone: "",
      setData: (data) => set(() => data),
    }),
    {
      name: "userInfo",
      storage: createJSONStorage(() => localStorage),
    },
  ),
);
